const express = require("express");
const app = express();
// app.use("*",function(){
//     res.set("Access-Control-Allow-Origin","*");
// })
app.get("/info",function(req,res){
    // res.set("Access-Control-Allow-Origin","*");
    res.json({
        ok:1,
        msg:"success"
    })
})

app.get("/jsonp",function(req,res){
    const {callback="cb",a,b,c} = req.query;
    const obj = {
        ok:1,
        msg:"success",
        a,
        b,
        c
    }
    res.send(callback+"("+JSON.stringify(obj)+")")
    // res.send(callback+"({ok:1,msg:\"success\"},a=,b,c);");
})


app.listen(80,function(){
    console.log("success");
})